<nav class="navbar navbar-default navbar-custom">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/<%= global.config.path.contextPath %>">
                <img src="<%= global.config.path.publicPath %>/custom/images/icon/favicon.png" class="img-responsive" />
                <%=global.config.title %>平台
            </a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <!--<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>-->
                <% if(userData && userData.menu){ %>
                <% let i,j;%>
                <% for(i = 0; i < userData.menu.rows.length; i++){ %>
                <% if(userData.menu.rows[i].__type == 'folder'){ %>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><%=userData.menu.rows[i].name %> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <% for(j = 0; j < userData.menu.rows[i].children.length; j++){ %>
                        <li menuCode="<%=userData.menu.rows[i].children[j].code %>" ><a href="<%= global.config.path.contextPath %><%=userData.menu.rows[i].children[j].link %>"><%=userData.menu.rows[i].children[j].name %></a></li>
                        <% } %>
                    </ul>
                </li>
                <% }else{ %>
                <li menuCode="<%=userData.menu.rows[i].code %>" ><a href="<%= global.config.path.contextPath %><%=userData.menu.rows[i].link %>"><%=userData.menu.rows[i].name %></a></li>
                <% } %>
                <% }}else{ %>
                <li><a href="#">首页</a></li>
                <% if(userData && userData.role == "admin"){ %>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">系统管理 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li menuCode="userList" ><a href="<%= global.config.path.contextPath %>/view/auth/userManagement">账号管理</a></li>
                        <li menuCode="menuList" ><a href="<%= global.config.path.contextPath %>/view/auth/menuManagement">菜单管理</a></li>
                        <li role="separator" class="divider"></li>
                        <li menuCode="dictList" ><a href="<%= global.config.path.contextPath %>/view/system/dictManagement">数据字典</a></li>
                    </ul>
                </li>
                <!--<li><a href="<%= global.config.path.contextPath %>/view/doc/doc">接口文档</a></li>-->
                <% } %>
                <% } %>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#"></a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><%= userData.name %> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">修改密码</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="<%= global.config.path.contextPath %>/login/logout">退出账号</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>